<template>
  <j-modal
    :title="title"
    :width="1100"
    :visible="visible"
    @cancel="onCancel"
    :confirmLoading="confirmLoading"
    :footer="null"
    switchFullscreen
  >
    <div style="width:100%;text-align: center;">
      <img alt="流程图获取失败" :src="previewImage" />
    </div>

  </j-modal>
</template>

<script>

  export default {
    name: 'ImageModal',
    components: {
    },
    data() {
      return {
        title: '流程图',
        visible: false,
        confirmLoading: false,
        model: '',
        previewImage: ''
      }
    },
    methods: {
      // 获取流程图
     getPreviewImage() {
       let processId = this.model.processInstanceId
      this.previewImage = window._CONFIG['domianURL'] + '/approval/task/processImg/' + processId
     },
      openModel(val) {
        this.previewImage = ''
         this.visible = true
         this.model = val
         this.getPreviewImage()
      },
      onCancel() {
        this.visible = false
      }
    }
  }
</script>

<style>
   @import '~@assets/less/common.less';
  .ant-modal-body {
      padding: 0px 15px 15px 15px;
   }
</style>
